package cn.cream4u.ksks.abService;

import cn.cream4u.ksks.acMapper.ClassMapper;
import cn.cream4u.ksks.adPojo.*;
import org.apache.catalina.mapper.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassImpl implements ClassServ {

    @Autowired
    ClassMapper classMapper;

    @Override
    public void addClass(ClassPojo pojo) {
        AClass clazz = new AClass(pojo.getEmp().getId(),pojo.getClassName(),pojo.getRoomName(),pojo.getStartTime(),pojo.getEndTime());
        classMapper.addClass(clazz);
    }

    @Override
    public void deleteClass(Integer[] kk) {
        classMapper.deleteClass(kk);
    }

    @Override
    public List<ClassPojo2> selectClass(int page, int pagesize, String name, String beginTime, String endTime) {
        return classMapper.selectClass((page-1)*pagesize,pagesize,name,beginTime,endTime);
    }

    @Override
    public List<ClassPojo3> selectAll() {
        return classMapper.selectAll();
    }

    @Override
    public List<ClassPojo4> selectJob(Integer job) {
        return classMapper.selectJob(job);
    }

    @Override
    public void change(ClassPojo5 pojo) {
        classMapper.change(pojo);
    }
}
